<html>
<head><meta charset="utf-8"><title>why do x.py fmt and cargo fmt do different things? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html">why do x.py fmt and cargo fmt do different things?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210327564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210327564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210327564">(Sep 16 2020 at 22:22)</a>:</h4>
<p>If I cargo fmt in bootstrap/ i get a different result than running x.py fmt. my vim has auto-rustfmt-on-save so I often have to run x.py fmt before submitting pr's</p>
<p>i dug around boostrap/format.rs, but couldn't find anything, is there a way we can reconcile these differences?</p>



<a name="210327614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210327614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210327614">(Sep 16 2020 at 22:23)</a>:</h4>
<p>x.py uses a custom version of rustfmt</p>



<a name="210327628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210327628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210327628">(Sep 16 2020 at 22:24)</a>:</h4>
<p>I would just turn off format on save I think, or set it to run <code>x.py fmt</code> instead.</p>



<a name="210327673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210327673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210327673">(Sep 16 2020 at 22:24)</a>:</h4>
<p>how is is customized?</p>



<a name="210327703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210327703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210327703">(Sep 16 2020 at 22:24)</a>:</h4>
<p><span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span> that's beyond my knowledge</p>



<a name="210327757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210327757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210327757">(Sep 16 2020 at 22:25)</a>:</h4>
<p>Ill dig into it!</p>



<a name="210328024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210328024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210328024">(Sep 16 2020 at 22:28)</a>:</h4>
<p>it's just a different version IIRC</p>



<a name="210328031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210328031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210328031">(Sep 16 2020 at 22:29)</a>:</h4>
<p>just a pinned version, yep</p>



<a name="210328039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210328039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210328039">(Sep 16 2020 at 22:29)</a>:</h4>
<p>you can find the nightly we use in src/stage0.txt</p>



<a name="210328665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210328665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210328665">(Sep 16 2020 at 22:37)</a>:</h4>
<p>see <a href="https://github.com/rust-lang/rust/issues/74274">https://github.com/rust-lang/rust/issues/74274</a> for more info</p>



<a name="210328922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210328922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210328922">(Sep 16 2020 at 22:40)</a>:</h4>
<p>hmm yeah, its the unstable rustfmt version="Two"</p>
<p>maybe this: <a href="https://github.com/rust-lang/rustfmt/pull/4419">https://github.com/rust-lang/rustfmt/pull/4419</a> or something similar can make it so we can fix this at some point</p>



<a name="210328962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210328962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210328962">(Sep 16 2020 at 22:40)</a>:</h4>
<p>hm the version is configured in rustfmt.toml which should get picked up..</p>



<a name="210329327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210329327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210329327">(Sep 16 2020 at 22:46)</a>:</h4>
<p>"Warning: can't set <code>version = Two</code>, unstable features are only available in nightly channel."</p>
<p>cargo +nightly fmt works<br>
i forget, can cargo by configured to choose a toolchain based on the crate?</p>



<a name="210329366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210329366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210329366">(Sep 16 2020 at 22:47)</a>:</h4>
<p>rustup can choose it based on the directory</p>



<a name="210329374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210329374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210329374">(Sep 16 2020 at 22:47)</a>:</h4>
<p>I forget exactly how</p>



<a name="210329493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210329493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210329493">(Sep 16 2020 at 22:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F/near/210328031">said</a>:</p>
<blockquote>
<p>just a pinned version, yep</p>
</blockquote>
<p>oh we pin it, which gets us around this: <a href="https://github.com/rust-lang/rustfmt/pull/4235">https://github.com/rust-lang/rustfmt/pull/4235</a><br>
Is there a plan to stop pinning it before this?</p>



<a name="210329641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210329641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210329641">(Sep 16 2020 at 22:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F/near/210329366">said</a>:</p>
<blockquote>
<p>rustup can choose it based on the directory</p>
</blockquote>
<p>"rustup override set nightly"...tempting to add this to the dev guide...</p>



<a name="210329664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210329664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210329664">(Sep 16 2020 at 22:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="257428">Gus Wynn</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F/near/210329641">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F/near/210329366">said</a>:</p>
<blockquote>
<p>rustup can choose it based on the directory</p>
</blockquote>
<p>"rustup override set nightly"...tempting to add this to the dev guide...</p>
</blockquote>
<p>go for it :)</p>



<a name="210330942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210330942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210330942">(Sep 16 2020 at 23:09)</a>:</h4>
<p>woah, this even works on the rustfmt binary, so editors that use rustfmt work as well<br>
how does rustup work, its magic!</p>



<a name="210331029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331029">(Sep 16 2020 at 23:10)</a>:</h4>
<p><span class="user-mention" data-user-id="223910">@Daniel Silverstone</span> you have an admirer ;)</p>



<a name="210331065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331065">(Sep 16 2020 at 23:10)</a>:</h4>
<p><span class="user-mention" data-user-id="257428">@Gus Wynn</span> btw this would be a good place in the dev guide: <a href="https://rustc-dev-guide.rust-lang.org/building/suggested.html?highlight=suggested#suggested-workflows">https://rustc-dev-guide.rust-lang.org/building/suggested.html?highlight=suggested#suggested-workflows</a></p>



<a name="210331119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331119">(Sep 16 2020 at 23:11)</a>:</h4>
<p>but actually, does rustup build binaries that dispatch to other binaries? which rustfmt just sends me to a binary in .cargo/bin</p>



<a name="210331129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331129">(Sep 16 2020 at 23:11)</a>:</h4>
<p>basically, yes</p>



<a name="210331132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331132">(Sep 16 2020 at 23:11)</a>:</h4>
<p>Maybe a symlink in .rustup?</p>



<a name="210331135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331135">(Sep 16 2020 at 23:11)</a>:</h4>
<p>no, it's not a symlink</p>



<a name="210331139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331139">(Sep 16 2020 at 23:11)</a>:</h4>
<p>it's its own binary</p>



<a name="210331158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331158">(Sep 16 2020 at 23:12)</a>:</h4>
<p>that's how <code>cargo +nightly</code> works</p>



<a name="210331206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331206">(Sep 16 2020 at 23:12)</a>:</h4>
<p>Hmm, I'll have to read more about rustup! It is one of the magical parts of Rust that toolchain updates and package updates are so easy :)</p>



<a name="210331409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331409">(Sep 16 2020 at 23:15)</a>:</h4>
<p><a href="https://rust-lang.github.io/rustup/">https://rust-lang.github.io/rustup/</a> has a lot of good info</p>



<a name="210331506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331506">(Sep 16 2020 at 23:15)</a>:</h4>
<p><code>~/.cargo/bin/rustc</code>, <code>cargo</code>, etc. are all hardlinks (on Linux) to the same <code>rustup</code> binary, which looks at <code>arg[0]</code> to see how it was invoked, and the working dir etc. to choose the appropriate toolchain, then <code>exec</code>s to the real tool</p>



<a name="210331732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20do%20x.py%20fmt%20and%20cargo%20fmt%20do%20different%20things%3F/near/210331732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20do.20x.2Epy.20fmt.20and.20cargo.20fmt.20do.20different.20things.3F.html#210331732">(Sep 16 2020 at 23:19)</a>:</h4>
<p>beautiful</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>